package com.jmu.edu.IMApplication.event;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

public class SwitchFragmentEvent {
    private Fragment showFragment;
    private String showTag;
    private String hideTag;

    public String getHideTag() {
        return hideTag;
    }

    public void setHideTag(String hideTag) {
        this.hideTag = hideTag;
    }

    public SwitchFragmentEvent(Fragment showFragment, String showTag, String hideTag) {
        this.showFragment = showFragment;
        this.showTag = showTag;
        this.hideTag = hideTag;
        // 要hide的Tag也就是这个showFragment回退后应该要显示的Fragment
        Bundle bundle = new Bundle();
        bundle.putString("backTag", hideTag);
        showFragment.setArguments(bundle);
    }

    public String getShowTag() {
        return showTag;
    }

    public void setShowTag(String showTag) {
        this.showTag = showTag;
    }

    public Fragment getShowFragment() {
        return showFragment;
    }

    public void setShowFragment(Fragment showFragment) {
        this.showFragment = showFragment;
    }
}
